package dev.touchswipe.shared.components
{
	import dev.touchswipe.shared.Fonts;
	import dev.touchswipe.shared.components.assets.ButtonGraphic;
	
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;

	public class Button extends ButtonGraphic
	{
		private var _textField:TextField=new TextField();
		private var _text:String;
		public function Button(buttonText:String)
		{
			_textField=new TextField();
			_text=buttonText;
			var textFmt:TextFormat=new TextFormat(Fonts.SegoeUIL,15,0x000000);
			textFmt.align=TextFormatAlign.CENTER;
			_textField.defaultTextFormat=textFmt;
			_textField.text=_text;
			_textField.width=width;
			_textField.height=height;
			_textField.selectable=false;
			_textField.embedFonts=true;
			addChild(_textField);
		}
	}
}